package com.android.pandoid;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * Date: 2020/8/19 10:27
 * Author: Tatum
 * Description: TODO
 */
class PersonMethodInterceptor implements MethodInterceptor {

    private Object target;

    public PersonMethodInterceptor(Object target) {
        this.target = target;
    }

    @Override
    public Object intercept(Object o, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
        System.out.println("o  o ="+o.getClass().getSimpleName());
        System.out.println("method  name ="+method.getName());
        System.out.println("methodProxy  name ="+methodProxy.getSuperName());
        final Object invoke = method.invoke(target, args);

        return invoke;
    }
}
